﻿using System;
using System.Globalization;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace System.ComponentModel
{
    public sealed class EditorAttribute : Attribute
    {
        private string typeName;
        private string propertyToBind;

        // Methods
        public EditorAttribute()
        {
            this.typeName = string.Empty;
        }

        public EditorAttribute(string typeName, string propertyToBind)
        {
            typeName.ToUpper(CultureInfo.InvariantCulture);
            this.typeName = typeName;
            this.propertyToBind = propertyToBind;
        }


        public EditorAttribute(Type type, string propertyToBind)
        {
            this.typeName = type.AssemblyQualifiedName;
            this.propertyToBind = propertyToBind;
        }

        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return true;
            }
            EditorAttribute attribute = obj as EditorAttribute;
            return (((attribute != null) && (attribute.typeName == this.typeName)) );
        }

        public string EditorTypeName
        {
            get
            {
                return this.typeName;
            }
        }

        public string PropertyToBind
        {
            get { return propertyToBind; }
        }
    }
}
